USE Liberty
GO

-- ------------------------------------------------------------------------------------------------
-- States Table Create Script
-- ------------------------------------------------------------------------------------------------
SET NOCOUNT OFF
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
SET ARITHABORT ON
SET CONCAT_NULL_YIELDS_NULL ON
SET QUOTED_IDENTIFIER ON
SET NUMERIC_ROUNDABORT OFF
GO

PRINT 'Creating Table dbo.States...'
GO

IF OBJECT_ID('dbo.States', 'U') IS NULL
BEGIN
	CREATE TABLE dbo.States
	(
		OID				BIGINT		IDENTITY(1, 1)	NOT NULL,
		Version			ROWVERSION					NOT	NULL,
		Description		VARCHAR(64)					NOT NULL,
		Active			TINYINT						NOT NULL CONSTRAINT DFLT_States_Active DEFAULT (1),
		DisplayOrder	SMALLINT					NOT NULL CONSTRAINT DFLT_States_DisplayOrder DEFAULT (1)
		CONSTRAINT PK_States PRIMARY KEY CLUSTERED( OID ) --ON PRIMARY
	)

	PRINT 'Table dbo.States has been created successfully.'

END
ELSE 
BEGIN
    PRINT 'Table dbo.States already exists.'
END

GO
